import request from '@/utils/request'

export function MaterialInfo(params) {
  return request({
    url: `/ProductResourceManager/MaterialManager/MaterialInfo/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function MaterialTypeManager(params) {
  return request({
    url: `/MaterialManager/MaterialType/MaterialTypeManager/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}
export function MaterialType(data) {
  return request({
    url: '/MaterialManager/MaterialType/MaterialTypeManager/',
    method: 'post',
    data,
  })
}

export function MaterialTypeDelete(data) {
  return request({
    url: `/MaterialManager/MaterialType/MaterialTypeManager/MaterialType=${data.MaterialType}`,
    method: 'delete',
    data,
  })
}

export function SupplierManager(params) {
  return request({
    url: `/MaterialManager/MaterialType/SupplierManager/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function SupplierManagerInfo(data) {
  return request({
    url: '/MaterialManager/MaterialType/SupplierManager/',
    method: 'post',
    data,
  })
}

export function SupplierManagerDelete(data) {
  return request({
    url: `/MaterialManager/MaterialType/SupplierManager/SupplierName=${data.SupplierName}`,
    method: 'delete',
    data,
  })
}
export function SupplierManagerDelete1(data) {
  return request({
    url: `/MaterialManager/TrayManager/SupplierManager/SupplierName=${data.SupplierName}`,
    method: 'delete',
    data,
  })
}

export function ProductInfo(data) {
  return request({
    url: '/ProductInfo/PartManager/PartNewly/',
    method: 'post',
    data,
  })
}

// 设备保养信息
export function InformationStatistics(params) {
  return request({
    url: `/DeviceManager/Mainrenance/Information/Statistics`,
    method: 'get',
    params,
  })
}

//待保养设备列表获取
export function WaitMainrenanceList(params) {
  return request({
    url: `/DeviceManager/Mainrenance/Information/WaitMainrenanceList/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}
//保养记录获取（今日已保养，本月已保养也使用该接口）
export function FinishMainrenanceList(params) {
  return request({
    url: `/DeviceManager/Mainrenance/Information/FinishMainrenance/Type=${params.type}&Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function TrayManagerInfo(params) {
  return request({
    url: `/MaterialManager/TrayManager/TrayInfo/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function GetProduction(params) {
  return request({
    url: `/PlanAndProduction/OrderManager/GetProduction`,
    method: 'get',
    params,
  })
}

export function TrayManager(data) {
  return request({
    url: `/MaterialManager/TrayManager/TrayInfo/`,
    method: 'post',
    data,
  })
}

export function TrayInfoDelete(data) {
  return request({
    url: `/MaterialManager/TrayManager/TrayInfo/TrayType=${data.TrayType}`,
    method: 'delete',
    data,
  })
}

export function TrayTypeInfo(data) {
  return request({
    url: `/MaterialManager/TrayManager/TrayTypeInfo/`,
    method: 'post',
    data,
  })
}

export function TrayTypeInfoList(params) {
  return request({
    url: `/MaterialManager/TrayManager/TrayTypeInfo/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function TrayTypeInfoDelete(data) {
  return request({
    url: `/MaterialManager/TrayManager/TrayTypeInfo/TrayType=${data.TrayType}`,
    method: 'delete',
    data,
  })
}

export function TrayInfo(params) {
  return request({
    url: `/MaterialManager/TrayManager/TrayInfo/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function TraySupplierManager(params) {
  return request({
    url: `/MaterialManager/TrayManager/SupplierManager/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function SupplierManagers(data) {
  return request({
    url: `/MaterialManager/TrayManager/SupplierManager`,
    method: 'post',
    data,
  })
}

export function WarehouseManager(params) {
  return request({
    url: `/MaterialManager/TrayManager/WarehouseManager/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}
//保养方案管理列表
export function MainrenancePlanList(params) {
  return request({
    url: `/DeviceManager/Mainrenance/PlanManager/Index=${params.Index}&Count=${params.Count}&MatchString=${params.MatchString}`,
    method: 'get',
    params,
  })
}

export function EquipmentDelete(data) {
  return request({
    url: `/DeviceManager/Mainrenance/PlanManager/MainrenancePlanId=${data.MainrenancePlanId}`,
    method: 'delete',
    data,
  })
}
export function AllDeviceld(data) {
  return request({
    url: `/DeviceManager/DeviceInfo/AllDeviceId`,
    method: 'get',
    data,
  })
}
//保养方案
// 新增保养方案
export function PlanManagerNewly(data) {
  return request({
    url: '/DeviceManager/Mainrenance/PlanManager/Newly/',
    method: 'post',
    data,
  })
}

export function PlanManagerRenew(data) {
  return request({
    url: '/DeviceManager/Mainrenance/PlanManager/Renew/',
    method: 'post',
    data,
  })
}
//获取所有设备类型

export function GetAllDeviceType(params) {
  return request({
    url: `/DeviceManager/DeviceInfo/GetAllDeviceType/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function InventoryInfo(params) {
  return request({
    url: `/MaterialManager/TrayManager/InventoryInfo/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

//设备保修单信息获取
export function ReportManagerList(params) {
  return request({
    url: `/DeviceManager/Repair/ReportManager/Index=${params.Index}&Count=${params.Count}&MatchString=${params.MatchString}`,
    method: 'get',
    params,
  })
}
//设备保修单删除
export function ReportManagerDelete(data) {
  return request({
    url: `/DeviceManager/Repair/ReportManager/RepairId=${data.RepairId}`,
    method: 'delete',
    data,
  })
}
//设备保修单更新
export function ReportManagerRenew(data) {
  f
  return request({
    url: '/DeviceManager/Repair/ReportManager/Renew/',
    method: 'post',
    data,
  })
}
//设备保修单新增
export function ReportManagerNewly(data) {
  return request({
    url: '/DeviceManager/Repair/ReportManager/Newly/',
    method: 'post',
    data,
  })
}

export function MainrenancePlanIdDelete(data) {
  return request({
    url: `/DeviceManager/Mainrenance/PlanManager/MainrenancePlanId/MainrenancePlanId=${data.MainrenancePlanId}`,
    method: 'delete',
    data,
  })
}

export function AlarmKnifeInfoList(params) {
  return request({
    url: `/MaterialManager/KnifeManager/AlarmKnifeInfo/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function SerachItemList(params) {
  return request({
    url: `/MaterialManager/KnifeManager/SerachItemList`,
    method: 'get',
    params,
  })
}

export function KnifeInfoThresholdNewly(data) {
  return request({
    url: '/MaterialManager/KnifeManager/KnifeInfoThreshold/Newly/',
    method: 'post',
    data,
  })
}

export function SetThresholdList(params) {
  return request({
    url: `/MaterialManager/KnifeManager/KnifeInfoThreshold/SetThreshold/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function KnifeNewly(data) {
  return request({
    url: '/MaterialManager/KnifeManager/KnifeNewly/',
    method: 'post',
    data,
  })
}

export function KnifeManagerList(params) {
  return request({
    url: `/MaterialManager/KnifeManager/LibList`,
    method: 'get',
    params,
  })
}

export function KnifeMigrate(data) {
  return request({
    url: '/MaterialManager/KnifeManager/KnifeMigrate/',
    method: 'post',
    data,
  })
}

export function KnifeLibOut(data) {
  return request({
    url: '/MaterialManager/KnifeManager/KnifeLibOut/',
    method: 'post',
    data,
  })
}

export function KnifeDiscard(data) {
  return request({
    url: '/MaterialManager/KnifeManager/KnifeDiscard/',
    method: 'post',
    data,
  })
}

export function KnifeInfoThresholdList(params) {
  return request({
    url: `/MaterialManager/KnifeManager/KnifeInfo/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}
//毛坯料设置报警阈值
export function SetThreshold(data) {
  return request({
    url: `/MaterialManager/MaterialType/SetThreshold/MaterialType=${data.MaterialType}&Threshold=${data.Threshold}`,
    method: 'post',
    data,
  })
}
//修改质检结果
export function SetMaterialQualityResult(data) {
  return request({
    url: `/MaterialManager/SetMaterialQualityResult/MaterialId==${data.MaterialId}&Result=${data.Result}`,
    method: 'post',
    data,
  })
}

export function TrayTypeUpdate(data) {
  return request({
    url: `/MaterialManager/TrayManager/TrayTypeUpdate/`,
    method: 'post',
    data,
  })
}

export function MaterialTypeUpdate(data) {
  return request({
    url: `/MaterialManager/MaterialType/MaterialTypeUpdate/`,
    method: 'post',
    data,
  })
}
